home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_6394.txt < prev    next >
Text File  |  1989-02-26  |  7KB  |  234 lines

  1. -- card: 6394 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 2612
  5. -- name: DoList
  6. ----- HyperTalk script -----
  7. on closecard
  8.   hide message window
  9. end closecard
  10.  
  11.  
  12.  
  13. -- part 1 (button)
  14. -- low flags: 00
  15. -- high flags: A004
  16. -- rect: left=184 top=33 right=52 bottom=242
  17. -- title width / last selected line: 0
  18. -- icon id / first selected line: 0 / 0
  19. -- text alignment: 1
  20. -- font id: 0
  21. -- text size: 12
  22. -- style flags: 0
  23. -- line height: 16
  24. -- part name: Mode 1
  25. ----- HyperTalk script -----
  26. on mouseUp
  27.   if the optionkey is down then
  28.     pass mouseup
  29.   end if
  30.  
  31.   put card field list into theList
  32.   DoList 999,theList,one
  33.   put the result
  34. end mouseUp
  35.  
  36.  
  37.  
  38. -- part 2 (button)
  39. -- low flags: 00
  40. -- high flags: A004
  41. -- rect: left=262 top=33 right=52 bottom=320
  42. -- title width / last selected line: 0
  43. -- icon id / first selected line: 0 / 0
  44. -- text alignment: 1
  45. -- font id: 0
  46. -- text size: 12
  47. -- style flags: 0
  48. -- line height: 16
  49. -- part name: Mode 2
  50. ----- HyperTalk script -----
  51. on mouseUp
  52.   if the optionkey is down then
  53.     pass mouseup
  54.   end if
  55.  
  56.   put card field list into theList
  57.   DoList "Select","Cancel",theList,one
  58.   put the result
  59. end mouseUp
  60.  
  61.  
  62.  
  63. -- part 3 (button)
  64. -- low flags: 00
  65. -- high flags: A004
  66. -- rect: left=338 top=33 right=52 bottom=396
  67. -- title width / last selected line: 0
  68. -- icon id / first selected line: 0 / 0
  69. -- text alignment: 1
  70. -- font id: 0
  71. -- text size: 12
  72. -- style flags: 0
  73. -- line height: 16
  74. -- part name: Mode 3
  75. ----- HyperTalk script -----
  76. on mouseUp
  77.   if the optionkey is down then
  78.     pass mouseup
  79.   end if
  80.  
  81.   put card field list into theList
  82.   DoList "Select","Cancel",theList,DIS,20,156
  83.   put the result
  84. end mouseUp
  85.  
  86.  
  87.  
  88. -- part 4 (field)
  89. -- low flags: 81
  90. -- high flags: 0002
  91. -- rect: left=171 top=36 right=133 bottom=340
  92. -- title width / last selected line: 0
  93. -- icon id / first selected line: 0 / 0
  94. -- text alignment: 0
  95. -- font id: 3
  96. -- text size: 12
  97. -- style flags: 0
  98. -- line height: 16
  99. -- part name: list
  100.  
  101.  
  102. -- part 5 (button)
  103. -- low flags: 00
  104. -- high flags: A003
  105. -- rect: left=82 top=302 right=324 bottom=182
  106. -- title width / last selected line: 0
  107. -- icon id / first selected line: 0 / 0
  108. -- text alignment: 1
  109. -- font id: 0
  110. -- text size: 12
  111. -- style flags: 0
  112. -- line height: 16
  113. -- part name: Install
  114. ----- HyperTalk script -----
  115. on mouseUp
  116.   if the optionkey is down then
  117.     pass mouseup
  118.   end if
  119.  
  120.   put (long name of this stack) into sourceStack
  121.   delete first word of sourceStack
  122.   delete first character of sourceStack
  123.   delete last character of sourceStack
  124.   put "Select a stack to copy this resource into."
  125.   put filename("STAK") into fname
  126.   if fname is empty then
  127.     hide message window
  128.     exit mouseup
  129.   end if
  130.   if sourcestack=fname then
  131.     beep
  132.     Answer "Get real.  You can't install it in this stack"
  133.     hide message window
  134.     exit mouseup
  135.   end if
  136.  
  137.   --
  138.   ModResCopy sourceStack,fname,"XCMD","DoList"
  139.   --
  140.   get the result
  141.   if first char of it is "E" then
  142.     put it into the message box
  143.     beep
  144.     answer "Attempt to install resource has failed."
  145.   else
  146.     beep
  147.     answer "Resource installation successful"
  148.   end if
  149.   hide message window
  150. end mouseUp
  151.  
  152.  
  153.  
  154. -- part contents for background part 2
  155. ----- text -----
  156. DoList
  157.  
  158. -- part contents for background part 13
  159. ----- text -----
  160. 6
  161.  
  162. -- part contents for background part 3
  163. ----- text -----
  164.  
  165. DoList gives you the ability to handle a scrolling list of text strings, allowing a user to select one or more items from a long list.
  166.  
  167. DoList can be used in three different modes:
  168.  
  169. Mode 1:  Uses a dialog resource for the list. This requires 2 additional resources in the stack, 1 'DLOG' and its 'DITL' resource. 
  170. ‚Ä¢<Resource ID> is the ID of the 'DLOG' resource in the stack. 
  171. ‚Ä¢Item 1 must be a button item, and is used for the Select button. It can have any position and rectangle, and is not reset.
  172. ‚Ä¢Item 2 must be a button item, and is used for the Cancel button. It can have any position and rectangle, and is not reset.
  173. ‚Ä¢Item 3 must be a useritem, and is used for the list window. It must have the rectangle and position you wish to use for the list.
  174. ‚Ä¢Item 4 must be a useritem, and is used for outlining the Select button.  It can have any rectangle, since its rect will be set for you.
  175.    Make sure that the vertical size of useritem 3 (the list window) is a multiple of 15. This insures that it will have the proper appearance.
  176.    Make sure the visible bit of the dialog resource is false. If the dialog is initially visible, its appearance while it is being drawn to the screen is not as clean and professional-looking.
  177.  
  178. Mode 2:  Requires NO additional resources at all. This is the simplest and most common mode. The list box will always appear in the center of the HyperCard window, and will always have the same orientation.
  179.  
  180. Mode 3:  Same as mode 2, but the list box position can be anywhere on the HyperCard window. The size and orientation of the box are not changed, only its location on the window.
  181.  
  182. HyperList Copyright ¬©1987 By James L. Paul
  183.  
  184. Paul Software Engineering
  185. RE: HyperList
  186. 513 West "A" Street
  187. Tehachapi, CA 93561
  188.  
  189. Compuserve 72767,3436
  190. GEnie J.Paul
  191.  
  192. Release 2.1 November 11,1987
  193.  
  194. All commercial distribution rights reserved. The XCMD resources and information in this stack may be freely used and distributed for any purpose except direct sale of the DoList XCMD. No guarantees are given as to the performance of this software, and the author is not liable for any losses incured by any user.
  195.  
  196. If you use DoList in one of your stacks for distribution, please include my name in your about box. This type of credit is my only compensation, and is a motivating factor for releasing routines such as these free of charge.
  197.  
  198.  
  199. -- part contents for card part 4
  200. ----- text -----
  201. Zebra,Elephant,Squirrel,Horse,Fox,Chicken,Cow,Roadrunner,Rabbit,Cobra,Beaver,Frog,Deer,Spider
  202.  
  203.  
  204. -- part contents for background part 10
  205. ----- text -----
  206. Syntax:
  207.  
  208. Mode 1: DoList <Resource ID>,
  209. <List>,<Flag>
  210. Mode 2: DoList <Button 1 Name>,
  211. <Button 2 Name>,<List>,<Flag>
  212. Mode 3: DoList <Button 1 Name>,
  213. <Button 2 Name>,<List>,<Flag>,<H>,<V>
  214.  
  215.   <Button 1> Name is the name of the Select button.
  216.    <Button 2> Name is the name of the Cancel button.
  217.    <List> is the actual list of items separated by commas.
  218.    <Flag> is 1 of 3 possible values, and determines list characteristics.
  219.    <H> is the horizontal coordinate for the list box in local coordinates.
  220.    <V> is the vertical coordinate for the list box in local coordinates.
  221.  
  222. Flag Setting:
  223.   The <Flag> parameter is passed in every mode, and determines how many items the user can select, and affects how they are selected.  It should be one of the following:
  224.  
  225. ONE    Will allow the user to select only 1 item from the list.
  226.  
  227. CON    Will allow the user to select 1 or more items from the list, with the items being continous.
  228.  
  229. DIS     Will allow the user to select 1 or more items from the list, in any order, not necessarily continous.
  230.  
  231.   The Result:
  232.    If it is empty, then the user clicked on the Cancel button. Otherwise, item 1 of it will be the number of items selected.   Item 2 will be the list of items selected.
  233.  
  234.